#!/usr/bin/python3
# -*- coding: utf8 -*-
# Date   : 2021/06/26
# Author : Kwan
# Email  : allenxian@live.com
# Blog   : https://my.oschina.net/u/4173440

from .prepare import app
from .wsocket import socketio
from .routes import *


def create_app():
    """
    注册路由
    """
    app.register_blueprint(blueprint=index, url_prefix='/')
    app.register_blueprint(blueprint=auth, url_prefix='/auth')
    app.register_blueprint(blueprint=charge, url_prefix='/charge')
    app.register_blueprint(blueprint=records, url_prefix='/records')
    app.register_blueprint(blueprint=members, url_prefix='/members')
    app.register_blueprint(blueprint=recovery, url_prefix='/recovery')
    app.register_blueprint(blueprint=reports, url_prefix='/reports')
    app.register_blueprint(blueprint=carpark, url_prefix='/carpark')
    app.register_blueprint(blueprint=server, url_prefix='/server')
    app.register_blueprint(blueprint=devices, url_prefix='/devices')
    app.register_blueprint(blueprint=logs, url_prefix='/logs')
    app.register_blueprint(blueprint=interface, url_prefix='/interface')
    app.register_blueprint(blueprint=api, url_prefix='/api/v2')
    return app